<?php 
	function using( $namespace ) {
		foreach ( glob( dirname( __FILE__ ) . '/' . str_replace( '.', '/', $namespace ) . '/*.php' ) as $filename ) {
			include_once $filename;
		}
	}
	function set_global( $var, $value ) {
		eval( "global $" . $var . "; $" . $var . "='" . $value . "';" );
	}
	
	function get_global( $var ) {
		return eval( "global $" . $var . "; return $" . $var . ";" );
	}
	
	function redirect( $url, $delay = FALSE ){
		if( !headers_sent() && $delay == FALSE ){
			header( 'Location:' . $url );
		}elseif( !headers_sent() && $delay != FALSE ){
			header( 'Refresh:' . $delay . ';' . $url );
		}else{
			if( $delay == FALSE ){
				$delay = 0;
		}
			echo "<meta http-equiv=\"refresh\" content=\"" . $delay . ";" . $url . "\">";
		}
	}
?>
